<?php
header("Content-type:text/html; charset=utf-8");

// 制定允许其他域名访问
header("Access-Control-Allow-Origin:*");
// 响应类型
header('Access-Control-Allow-Methods:POST');
// 响应头设置
header('Access-Control-Allow-Headers:x-requested-with, content-type');
include 'config.php';

$sql="select * from t_gg";//查询语句
$info = mysqli_query($conn,$sql);

// 把查询到的数据放到数组里面
$reslist = array();
$i=0;
while ($row=mysqli_fetch_row($info)){
  $reslist[$i] = $row;
    $i++;
}

// var_dump($reslist);
// 把数组返回给前端，由前端展示给用户看
echo json_encode($reslist);

$conn->close();   


?>